class IntegralDetail {
  String realName;
  String deptName;
  String headUrl;
  double totalGrade;
  double todayTotalGrade;
  List<IntegralItem> items;

  IntegralDetail({
    this.realName,
    this.deptName,
    this.headUrl,
    this.totalGrade,
    this.todayTotalGrade,
    this.items,
  });

  factory IntegralDetail.fromJson(Map<String, dynamic> json) {
    return IntegralDetail(
        realName: json['realName'],
        deptName: json['deptName'],
        headUrl: json['headUrl'],
        totalGrade: json['totalGrade'],
        todayTotalGrade: json['todayTotalGrade'],
        items: json['gradeDetails'] == null ? [] : (json['gradeDetails'] as List).map((e) => IntegralItem.fromJson(e)).toList());
  }
}

class IntegralItem {
  double grade;
  DateTime createTime;
  String ruleName;

  IntegralItem({
    this.grade,
    this.createTime,
    this.ruleName,
  });

  factory IntegralItem.fromJson(Map<String, dynamic> json) {
    return IntegralItem(
      grade: json['grade'],
      createTime: DateTime.parse(json['createTime']),
      ruleName: json['ruleName'],
    );
  }
}
